<template>
  <div class="loading-frame" v-show="mainStore.isloading" @click="isLoadingClick">
    <div class="loading">
      <img src="@/assets/img/home/full-screen-loading.gif" alt="">
    </div>
  </div>
</template>

<script setup>
import useMainStore from '@/store/modules/main';
import { storeToRefs } from 'pinia';
const mainStore = useMainStore()

function isLoadingClick() {
  mainStore.isloading = false
}
</script>

<style lang="less" scoped>
.loading-frame {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.5);

  display: flex;
  justify-content: center;
  align-items: center;

  .loading {
    width: 27.73333vw;
    height: 27.73333vw;
    background: url(/src/assets/img/home/loading-bg.png) 0 0 / 100% 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    img {
      width: 18.66667vw;
      height: 18.66667vw;
      margin-bottom: 2.13333vw;
    }
  }
}
</style>